package com.ruoyi.system.controller;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.domain.YdPortal;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.IYdPortalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 公开接口
 */
@RestController
@RequestMapping("/apiPublic")
public class ApiPublic {
    @Autowired
    private IYdPortalService ydPortalService;
    @Autowired
    private ISysDictDataService dictDataService;
    @Anonymous
    @GetMapping("/getYdPortalList")
    public AjaxResult getYdPortalList(YdPortal ydPortal)
    {
        ydPortal.setStatus("0");
        List<YdPortal> list = ydPortalService.selectYdPortalList(ydPortal);
        return AjaxResult.success(list);
    }
    @Anonymous
    @GetMapping("/getDictDataList")
    public AjaxResult getDictDataList(SysDictData dictData)
    {
        dictData.setDictType("portal_type");
        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
        return AjaxResult.success(list);
    }
}
